package com.tjetc.view.impl;

import com.tjetc.constant.CommonConstant;
import com.tjetc.exception.MessageException;
import com.tjetc.utils.ScannerUtils;
import com.tjetc.view.HotelBrowserPage;

/**
 * @Author: itda
 * @Date: 2024/5/13 14:10
 * @Description: HotelBrowserPageImpl
 */
public class HotelBrowserPageImpl implements HotelBrowserPage {
    @Override
    public int show() {
        while (true) {
            try {
                System.out.println("1.查看酒店基本信息");
                System.out.println("2.查看酒店基础设施");
                System.out.println("3.查看酒店评论");
                System.out.println("4.查看酒店评级");
                System.out.println("5.查看酒店描述");
                System.out.println("6.返回");
                System.out.println("请输入:");
                int option = ScannerUtils.sc.nextInt();
                if (option<1||option>6){
                    throw new MessageException(CommonConstant.COMMAND_ERROR);
                }
                return option;
            } catch (MessageException e) {
                System.out.println(e.getMessage());
            }
        }
    }
}
